<%-- 
    Document   : stat_mengikut_negeri
    Created on : Jun 28, 2013, 12:01:46 PM
    Author     : fikri
--%>

<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" media="screen" href="${pageContext.request.contextPath}/css/new_design/layout.css">
        <title>Statistik Mengikut Negeri</title>
        <script src="${pageContext.request.contextPath}/js/jquery-1.8.2.js" type="text/javascript"></script>
        <script type="text/javascript">
            
             $(document).ready( function() {
                
                var total = 0;
                $('.bil').each(function() {
                    total = parseInt(total) + parseInt($(this).val());
                });                
                $('#totalBil').text(total);
            });
            
            function cetak(param){
                var url = '${pageContext.request.contextPath}/report?' + param;
               popupWindow = window.open(
                url,'popUpWindow',
                'height=450,width=630,resizable=no,scrollbars=no,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
            }
        </script>

    </head>
    <body>
        <s:messages/>
        <s:errors/> 
        <br/>
        <s:useActionBean beanclass="th.stripes.util.ListUtil" id="listUtil" />
        <s:form action="/report" class="niceform">
            <div id="content">
                <div id="logo">
                    <span>
                        <img src="${pageContext.request.contextPath}/images/img/ribbon.png"/>               
                    </span>
                </div>
                <h3>
                    Carian Statistik Mengikut Negeri Dan Jantina
                </h3>   
                <p>
                    <label>Negeri :</label>
                    <s:select name="taha.negeri.code" id="negeri" class="required">                        
                        <c:forEach items="${listUtil.senaraiNegeri}" var="item">
                            <s:option value="${item.code}">${item.code} - ${item.desc}</s:option>
                        </c:forEach>
                    </s:select>&nbsp;
                </p>   
                <p>
                    <label>Jantina :</label>
                    <s:select name="taha.jantina.kod" id="negeri" class="required">     
                        <s:option value="00">00 - SEMUA JANTINA</s:option>
                        <c:forEach items="${listUtil.senaraiJantina}" var="item">
                            <s:option value="${item.kod}">${item.kod} - ${item.nama}</s:option>
                        </c:forEach>
                    </s:select>&nbsp;
                </p>
                <p align="center">                    
                    <s:submit name="searchByNegeri" value="Cari" class="button green button_blockUI"/>                    
                </p>
            </div>
            <div>
                <display:table name="${actionBean.senaraiStatTaha}" class="tablecloth" id="row" style="width:100%">
                    <display:column title="No."><center>${row_rowNum}</center></display:column>
                    <display:column title="Bilangan"><center>${row.count}</center><input type="hidden" class="bil" value="${row.count}"/></display:column>
                    <display:column title="Negeri"><center>${row.negeri}</center></display:column>
                    <c:if test="${!empty row.jantina}">
                        <display:column title="Jantina"><center>${row.jantina}</center></display:column>
                    </c:if>
                    </display:table>
            </div>
             <c:if test="${fn:length(actionBean.senaraiStatTaha) > 0}">
                        <div>
                            <p>
                                <label>Jumlah Keseluruhan : </label>
                                <font id="totalBil"/>                    
                            </p>  
                        </div>
                    </c:if>

            <%--c:if test="${!empty actionBean.senaraiStatTaha}">
                <div id="content">
                    <p align="center">                    
                    <s:submit name="cetakByNegeri" value="Cetak" class="button green button_blockUI"/>                    
                </p>
                </div>
            </c:if--%>
        </s:form>
    </body>
</html>

